<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
用户名:<input name="uname" id="u" value="">
密码:<input type="password" name="upass" id="p">
<button id="b" onclick="dian()">登录</button>
<span id="jg"></span>

</body>
</html>
<script>
    var uname=document.getElementById("u");
    var upass=document.getElementById("p")
    uname.value="sB柏帅"
    //验证方法
    function dian(){
        uname=document.getElementById("u");
        upass=document.getElementById("p")
        let jg=document.getElementById("jg")
        let u=uname.value
        let p=upass.value
        if (u==="001"&&p==="123"){
            //alert("登录成功")
            jg.innerHTML="登录成功"
        }else {
            //alert("登录失败")
            jg.innerHTML="登陆失败"
        }
    }
</script>